package top.infopub.mgr.bpa.dao;


import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import top.infopub.generic.GenericDao;
import top.infopub.mgr.bpa.domain.OutcaeSureDetailDomain;
import top.infopub.model.bpa.OutcaeSureDetail;


/** 对外建安产值确权清单分解子项明细(BPA_OUTCAE_SURE_DETAIL) **/
public interface OutcaeSureDetailDao extends GenericDao<OutcaeSureDetail, String> {

    /**
     * 批量添加对外建安产值确权清单分解子项明细
     */
    void insertByBatch(@Param("list") List<OutcaeSureDetail> outcaeSureDetails);

    /**
     * 根据分项名称和对外建安产值确权id查询开累对内确权总金额
     * @param subName 分项名称
     * @param refId 对外建安产值确权id
     * @return 
     * @see
     */
    BigDecimal selectAddupAmountBySubNameAndRefId(@Param("subName") String subName,
                                                  @Param("refId") String refId,
                                                  @Param("typeName") String typeName);

    /**
     * 根据分项名称和对外建安产值确权id查询开累对内确权总金额
     * @param subName 分项名称
     * @param refId 对外建安产值确权id
     * @return 
     * @see
     */
    BigDecimal selectAddupAmountBySubNameAfter(@Param("subName") String subName,
                                               @Param("refId") String refId,
                                               @Param("typeName") String typeName);
    
    
    /**
     * 通过proCode查询相关记录
     */
    List<OutcaeSureDetailDomain> queryByProCode(@Param("proCode") String proCode);
    
    BigDecimal selectAddupAmountPre(Map<String, Object> map);
    
    BigDecimal selectAddupAmountAfter(Map<String, Object> map);

}